package com.xf.common.core.entity.dmp;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author JoeyLiu
 * @create 2022-04-11 16:28
 */
@Data
@AllArgsConstructor
public class DmpOrganization implements Serializable {

    private String organizationId;

    /**
     * 名称
     */
    private String organizationName;

    /**
     * 昵称
     */
    private String displayName;

    /**
     * 网站地址
     */
    private String websiteUrl;

    /**
     * 图标
     */
    private String favicon;

    /**
     * 默认头像
     */
    private String defaultAvatar;


    /**
     * 是否可删除.0=可 1=不可以
     */
    private Integer delFlag;

    /**
     * jwt加解密密钥(客户端需要妥善保存)
     */
    private String secret;


    private String remark;


    @TableField(fill = FieldFill.INSERT)
    private String createdBy;


    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private Date createdDate;


    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;


    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private Date updatedDate;

    @Version

    @TableField(fill = FieldFill.INSERT)
    private Long dataVersion;


    @TableField(fill = FieldFill.INSERT)
    private Long concurrentVersion;

    /**
     * 数据是否有效，0:正常，1:删除
     */
    @TableLogic(value = "0",delval = "1") //value表示逻辑未删除值，delval表示逻辑删除设置的值

    @TableField(value = "`status`", fill = FieldFill.INSERT)
    private Integer status;

}